home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / src / demos / OpenGL / ideas / w.c < prev   
C/C++ Source or Header  |  1996-11-11  |  7KB  |  248 lines

  1. /*
  2.  * (c) Copyright 1993, Silicon Graphics, Inc.
  3.  * ALL RIGHTS RESERVED 
  4.  * Permission to use, copy, modify, and distribute this software for 
  5.  * any purpose and without fee is hereby granted, provided that the above
  6.  * copyright notice appear in all copies and that both the copyright notice
  7.  * and this permission notice appear in supporting documentation, and that 
  8.  * the name of Silicon Graphics, Inc. not be used in advertising
  9.  * or publicity pertaining to distribution of the software without specific,
  10.  * written prior permission. 
  11.  *
  12.  * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
  13.  * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
  14.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
  15.  * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
  16.  * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
  17.  * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
  18.  * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
  19.  * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
  20.  * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
  21.  * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
  22.  * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
  23.  * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
  24.  * 
  25.  * US Government Users Restricted Rights 
  26.  * Use, duplication, or disclosure by the Government is subject to
  27.  * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
  28.  * (c)(1)(ii) of the Rights in Technical Data and Computer Software
  29.  * clause at DFARS 252.227-7013 and/or in similar or successor
  30.  * clauses in the FAR or the DOD or NASA FAR Supplement.
  31.  * Unpublished-- rights reserved under the copyright laws of the
  32.  * United States.  Contractor/manufacturer is Silicon Graphics,
  33.  * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
  34.  *
  35.  * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
  36.  */
  37. #include <GL/gl.h>
  38.  
  39.  
  40.  
  41. float w_data[][2] = {
  42.     {2.400000, 12.899384-3.0},
  43.     {1.624615, 12.344969-3.0},
  44.     {1.513846, 11.790554-3.0},
  45.     {0.812308, 11.310061-3.0},
  46.     {1.292308, 10.570842-3.0},
  47.     {0.387692, 9.554415-3.0},
  48.     {1.163077, 8.907598-3.0},
  49.     {0.443077, 8.427105-3.0},
  50.     {1.236923, 7.983573-3.0},
  51.     {0.627692, 6.911705-3.0},
  52.     {1.218462, 6.874743-3.0},
  53.     {0.701538, 5.765914-3.0},
  54.     {1.089231, 5.858316-3.0},
  55.     {0.590769, 5.082136-3.0},
  56.  
  57.     {0.904615, 5.636550-3.0},
  58.     {1.070769, 6.227926-3.0},
  59.     {1.716923, 6.708419-3.0},
  60.     {1.993846, 7.577002-3.0},
  61.     {2.603077, 7.780287-3.0},
  62.     {2.621538, 8.408625-3.0},
  63.     {3.138462, 8.630390-3.0},
  64.     {3.193846, 9.314168-3.0},
  65.     {4.080000, 10.995893-3.0},
  66.     {4.209231, 11.550308-3.0},
  67.  
  68.     {4.689231, 12.954825-3.0},
  69.     {4.209231, 11.809035-3.0},
  70.     {4.615385, 12.030801-3.0},
  71.     {4.006154, 10.552361-3.0},
  72.     {4.633846, 10.995893-3.0},
  73.     {4.080000, 9.887064-3.0},
  74.     {4.966154, 9.850102-3.0},
  75.     {4.375385, 8.981520-3.0},
  76.     {5.409231, 8.889117-3.0},
  77.     {4.744616, 7.946612-3.0},
  78.     {5.704616, 7.687885-3.0},
  79.     {5.058462, 7.041068-3.0},
  80.     {5.889231, 6.135524-3.0},
  81.     {5.427692, 5.599589-3.0},
  82.     {5.501538, 5.026694-3.0},
  83.  
  84.     {5.630769, 5.414784-3.0},
  85.     {5.741539, 5.987679-3.0},
  86.     {6.203077, 6.264887-3.0},
  87.     {6.572308, 7.281314-3.0},
  88.     {7.347692, 7.817248-3.0},
  89.     {7.255384, 9.221766-3.0},
  90.     {7.993846, 9.166325-3.0},
  91.     {7.458462, 11.032854-3.0},
  92.     {8.603077, 11.550308-3.0},
  93.     {7.403077, 11.975359-3.0},
  94.     {8.510769, 12.511293-3.0},
  95.     {7.070769, 12.326488-3.0},
  96.     {7.956923, 12.936345-3.0},
  97.     {6.590769, 12.308008-3.0},
  98.     {7.236923, 12.954825-3.0},
  99.     {6.000000, 12.012321-3.0},
  100.     {6.461538, 12.511293-3.0},
  101.  
  102. };
  103.  
  104. void draw_w(void) {
  105.  
  106.     glBegin(GL_TRIANGLE_STRIP);
  107.     glVertex2fv(w_data[0]);
  108.     glVertex2fv(w_data[1]);
  109.     glVertex2fv(w_data[2]);
  110.     glVertex2fv(w_data[3]);
  111.     glVertex2fv(w_data[4]);
  112.     glVertex2fv(w_data[5]);
  113.     glVertex2fv(w_data[6]);
  114.     glVertex2fv(w_data[7]);
  115.     glVertex2fv(w_data[8]);
  116.     glVertex2fv(w_data[9]);
  117.     glVertex2fv(w_data[10]);
  118.     glVertex2fv(w_data[11]);
  119.     glVertex2fv(w_data[12]);
  120.     glVertex2fv(w_data[13]);
  121.     glEnd();
  122.  
  123.     glBegin(GL_TRIANGLE_STRIP);
  124.     glVertex2fv(w_data[14]);
  125.     glVertex2fv(w_data[15]);
  126.     glVertex2fv(w_data[16]);
  127.     glVertex2fv(w_data[17]);
  128.     glVertex2fv(w_data[18]);
  129.     glVertex2fv(w_data[19]);
  130.     glVertex2fv(w_data[20]);
  131.     glVertex2fv(w_data[21]);
  132.     glVertex2fv(w_data[22]);
  133.     glVertex2fv(w_data[23]);
  134.     glEnd();
  135.  
  136.     glBegin(GL_TRIANGLE_STRIP);
  137.     glVertex2fv(w_data[24]);
  138.     glVertex2fv(w_data[25]);
  139.     glVertex2fv(w_data[26]);
  140.     glVertex2fv(w_data[27]);
  141.     glVertex2fv(w_data[28]);
  142.     glVertex2fv(w_data[29]);
  143.     glVertex2fv(w_data[30]);
  144.     glVertex2fv(w_data[31]);
  145.     glVertex2fv(w_data[32]);
  146.     glVertex2fv(w_data[33]);
  147.     glVertex2fv(w_data[34]);
  148.     glVertex2fv(w_data[35]);
  149.     glVertex2fv(w_data[36]);
  150.     glVertex2fv(w_data[37]);
  151.     glVertex2fv(w_data[38]);
  152.     glEnd();
  153.  
  154.     glBegin(GL_TRIANGLE_STRIP);
  155.     glVertex2fv(w_data[39]);
  156.     glVertex2fv(w_data[40]);
  157.     glVertex2fv(w_data[41]);
  158.     glVertex2fv(w_data[42]);
  159.     glVertex2fv(w_data[43]);
  160.     glVertex2fv(w_data[44]);
  161.     glVertex2fv(w_data[45]);
  162.     glVertex2fv(w_data[46]);
  163.     glVertex2fv(w_data[47]);
  164.     glVertex2fv(w_data[48]);
  165.     glVertex2fv(w_data[49]);
  166.     glVertex2fv(w_data[50]);
  167.     glVertex2fv(w_data[51]);
  168.     glVertex2fv(w_data[52]);
  169.     glVertex2fv(w_data[53]);
  170.     glVertex2fv(w_data[54]);
  171.     glVertex2fv(w_data[55]);
  172.     glEnd();
  173.  
  174.     glBegin(GL_LINE_STRIP);
  175.     glVertex2fv(w_data[0]);
  176.     glVertex2fv(w_data[2]);
  177.     glVertex2fv(w_data[4]);
  178.     glVertex2fv(w_data[6]);
  179.     glVertex2fv(w_data[8]);
  180.     glVertex2fv(w_data[10]);
  181.     glVertex2fv(w_data[12]);
  182.     glVertex2fv(w_data[13]);
  183.     glVertex2fv(w_data[11]);
  184.     glVertex2fv(w_data[9]);
  185.     glVertex2fv(w_data[7]);
  186.     glVertex2fv(w_data[5]);
  187.     glVertex2fv(w_data[3]);
  188.     glVertex2fv(w_data[1]);
  189.     glVertex2fv(w_data[0]);
  190.     glEnd();
  191.  
  192.     glBegin(GL_LINE_STRIP);
  193.     glVertex2fv(w_data[14]);
  194.     glVertex2fv(w_data[16]);
  195.     glVertex2fv(w_data[18]);
  196.     glVertex2fv(w_data[20]);
  197.     glVertex2fv(w_data[22]);
  198.     glVertex2fv(w_data[23]);
  199.     glVertex2fv(w_data[21]);
  200.     glVertex2fv(w_data[19]);
  201.     glVertex2fv(w_data[17]);
  202.     glVertex2fv(w_data[15]);
  203.     glVertex2fv(w_data[14]);
  204.     glEnd();
  205.  
  206.     glBegin(GL_LINE_STRIP);
  207.     glVertex2fv(w_data[24]);
  208.     glVertex2fv(w_data[26]);
  209.     glVertex2fv(w_data[28]);
  210.     glVertex2fv(w_data[30]);
  211.     glVertex2fv(w_data[32]);
  212.     glVertex2fv(w_data[34]);
  213.     glVertex2fv(w_data[36]);
  214.     glVertex2fv(w_data[38]);
  215.     glVertex2fv(w_data[37]);
  216.     glVertex2fv(w_data[35]);
  217.     glVertex2fv(w_data[33]);
  218.     glVertex2fv(w_data[31]);
  219.     glVertex2fv(w_data[29]);
  220.     glVertex2fv(w_data[27]);
  221.     glVertex2fv(w_data[25]);
  222.     glVertex2fv(w_data[24]);
  223.     glEnd();
  224.  
  225.     glBegin(GL_LINE_STRIP);
  226.     glVertex2fv(w_data[39]);
  227.     glVertex2fv(w_data[41]);
  228.     glVertex2fv(w_data[43]);
  229.     glVertex2fv(w_data[45]);
  230.     glVertex2fv(w_data[47]);
  231.     glVertex2fv(w_data[49]);
  232.     glVertex2fv(w_data[51]);
  233.     glVertex2fv(w_data[53]);
  234.     glVertex2fv(w_data[55]);
  235.     glVertex2fv(w_data[54]);
  236.     glVertex2fv(w_data[52]);
  237.     glVertex2fv(w_data[50]);
  238.     glVertex2fv(w_data[48]);
  239.     glVertex2fv(w_data[46]);
  240.     glVertex2fv(w_data[44]);
  241.     glVertex2fv(w_data[42]);
  242.     glVertex2fv(w_data[40]);
  243.     glVertex2fv(w_data[39]);
  244.     glEnd();
  245.  
  246. }
  247.  
  248.